import {createRouter, createWebHistory} from 'vue-router'
import {createLoginComponent} from 'yklib'

const router = createRouter({
    // history: createWebHistory(import.meta.env.BASE_URL),
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/login' // 重定向到登录页面，如果不需要登录页面，可以直接将路由转到HomeView组件
        },
        {
            path: '/login', // 如果不需要登录页面，可以直接将路由转到HomeView组件
            name: 'login',
            component: createLoginComponent({})
        },
        {
            path: '/home',
            name: 'home',
            component: () => import('../views/HomeView.vue')
        },
        {
            path: '/about',
            name: 'about',
            component: () => import('../views/AboutView.vue')
        },
        {
            path: '/moveMySQLData',
            name: 'moveMySQLData',
            component: () => import('../views/MoveMySQL.vue')
        },
        {
            path: '/buildImage',
            name: 'buildImage',
            component: () => import('../views/BuildImage.vue')
        }
    ]
})

export default router
